/**
 * 
 */
package com.aceitunaproject.shared.exceptions.gamerules;

import com.aceitunaproject.shared.playerdata.PlayerData;

/**
 * @author Federico Bergstein
 * 
 * Extension of illegal action, adding data about the permission that was denied
 */
public class PermissionDeniedException extends IllegalActionException {

	
	private static final long serialVersionUID = 1L;
	private PlayerData playerDenying;

	
	public PermissionDeniedException(EnumIllegalAction reason,PlayerData playerDenying) {
		super(reason);
		this.playerDenying = playerDenying;
	}

	/**
	 * Sets the player data of the player that denies the permission.
	 * 
	 * @param playerDenying the player
	 */
	public void setPlayerDenying(PlayerData playerDenying) {
		this.playerDenying = playerDenying;
	}

	/**
	 * @return the player data of the player that denies the permission.
	 */
	public PlayerData getPlayerDenying() {
		return playerDenying;
	}
	

}
